#include "tcp_client.hpp"
#include <memory>

//指令使用文档
static void Usage(string pro)
{
    cout << "Usage:\n\t" << pro << " ip prot" << endl;
}

int main(int argc, char* argv[])
{
    //指令输入错误
    if(argc != 3)
    {
        Usage(argv[0]);
        exit(USAGE_FAIL);
    }

    unique_ptr<tcp_client> up_tcpc(new tcp_client(argv[1], stoi(argv[2]))); //智能指针

    up_tcpc->init();
    up_tcpc->start();

    return 0;
}